const evevlists = require("../sql/evenlist")
const sql = require('../sql/mysql');
const jwt = require("jsonwebtoken");

module.exports = (req,res)=>{

   sql.get(evevlists,req.fields).then((data)=>{
    data.forEach(item=>{
        item.duetime = Date.parse(item.time)
    });
    data.sort((a,b)=>{
        return b.duetime - a.duetime
    })
    res.send({
        code:0,
        msg:"获取成功",
        data,
    })
   })
}